A Binary Recursive Gcd Algorithm
نویسندگان
چکیده
The binary algorithm is a variant of the Euclidean algorithm that performs well in practice. We present a quasi-linear time recursive algorithm that computes the greatest common divisor of two integers by simulating a slightly modified version of the binary algorithm. The structure of our algorithm is very close to the one of the well-known Knuth-Schönhage fast gcd algorithm; although it does not improve on its O(M(n) log n) complexity, the description and the proof of correctness are significantly simpler in our case. This leads to a simplification of the implementation and to better running times.
منابع مشابه
On Schönhage's algorithm and subquadratic integer gcd computation
We describe a new subquadratic left-to-right gcd algorithm, inspired by Schönhage’s algorithm for reduction of binary quadratic forms, and compare it to the first subquadratic gcd algorithm discovered by Knuth and Schönhage, and to the binary recursive gcd algorithm of Stehlé and Zimmermann. The new gcd algorithm runs slightly faster than earlier algorithms, and it is much simpler to implement....
متن کاملBinary GCD Like Algorithms for Some Complex Quadratic Rings
On the lines of the binary gcd algorithm for rational integers, algorithms for computing the gcd are presented for the ring of integers in Q( √ d) where d ∈ {−2,−7,−11,−19}. Thus a binary gcd like algorithm is presented for a unique factorization domain which is not Euclidean (case d = −19). Together with the earlier known binary gcd like algorithms for the ring of integers in Q( √−1) and Q(√−3...
متن کاملAn Analysis of the Generalized Binary GCD Algorithm
In this paper we analyze a slight modification of Jebelean’s version of the k-ary GCD algorithm. Jebelean had shown that on n-bit inputs, the algorithm runs in O(n) time. In this paper, we show that the average running time of our modified algorithm is O(n/ logn). This analysis involves exploring the behavior of spurious factors introduced during the main loop of the algorithm. We also introduc...
متن کاملBinary GCD algorithm
The binary GCD algorithm, also known as Stein’s algorithm, is an algorithm that computes the greatest common divisor of two nonnegative integers. Stein’s algorithm uses simpler arithmetic operations than the conventional Euclidean algorithm; it replaces division with arithmetic shifts, comparisons, and subtraction. Although the algorithm was first published by the Israeli physicist and programm...
متن کاملFPGA Implementation of an Extended Binary GCD Algorithm for Systolic Reduction of Rational Numbers
We present the FPGA implementation of an extension of the binary plus–minus systolic algorithm which computes the GCD (greatest common divisor) and also the normal form of a rational number, without using division. A sample array for 8 bit operands consumes 83.4% of an Atmel 40K10 chip and operates at 25 MHz.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2004